package com.examples {
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Loader;
	import flash.display.LoaderInfo;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLRequest;

	/**
	 * @author blake
	 */
	public class Background extends Sprite {
		private var _bitmapData : BitmapData;
		private var _imageLoader : Loader = new Loader();

		public function Background() {
			makeBackground();
		}

		private function makeBackground() : void {
			_imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
			_imageLoader.load(new URLRequest("images/grungeBg.jpg"));
		}

		private	function onComplete(event : Event) : void {
			_bitmapData = Bitmap(LoaderInfo(event.target).content).bitmapData;
			Bitmap(_imageLoader.content).smoothing = true;
			addChild(_imageLoader.content);
		}
	}
}
